package fr.polichouz.geotracer.corelocator;

import java.util.HashMap;
import java.util.Map;

import fr.polichouz.geotracer.shared.SimpleLocation;

/**
 * Fake implementation of a Persistence Layer.
 * 
 * @author Yoyo
 */
public class FakePersistence implements PersistenceLayer {
    
    /** Accounts (mapping username --> password) */
    private Map<String, String> accounts;
    
    /** Locations (mapping username --> location) */
    private Map<String, SimpleLocation> locations;
    
    /**
     * Default constructor.
     */
    public FakePersistence() {
	accounts = new HashMap<String, String>();
	locations = new HashMap<String, SimpleLocation>();
	
	accounts.put("yoyomoony@gmail.com", "this is NOT my real password");
	locations.put("yoyomoony@gmail.com", new SimpleLocation(1587d, 44572d));
    }

    /**
     * @see fr.polichouz.geotracer.corelocator.PersistenceLayer#getAccounts()
     */
    @Override
    public Map<String, String> getAccounts() {
	return accounts;
    }

    /**
     * @see fr.polichouz.geotracer.corelocator.PersistenceLayer#getlocations()
     */
    @Override
    public Map<String, SimpleLocation> getlocations() {
	return locations;
    }

    /**
     * @see fr.polichouz.geotracer.corelocator.PersistenceLayer#persist()
     */
    @Override
    public void persist() {}

}
